#include <iostream>
#include <stdio.h>
#include <string.h>
#define SIZE 50
using namespace std;

char phrase[SIZE];

int main()
{
	int i, ok = 1, j;
	gets(phrase);
	
	for (i = 0; i < strlen(phrase); ++i)
		if (phrase[i] == ' ')
			for (j = i; j < strlen(phrase); ++j)
				phrase[j] = phrase[j + 1];
	
	for (i = 0, j = strlen(phrase) -1; i < strlen(phrase), j >= 0; ++i, --j)
		if(phrase[i] != phrase[j])
			ok = 0;
			
	cout << ok;
	
}

